package com.bmob.lover.ui.fragment.lol

import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.theone.common.ext.logI
import com.bmob.lover.R
import com.bmob.lover.data.model.bean.Album
import com.bmob.lover.data.model.bean.lol.LOLWelfare
import com.bmob.lover.ui.adapter.AlbumAdapter
import com.bmob.lover.ui.adapter.LOLWelfareAdapter
import com.bmob.lover.ui.fragment.base.BasePagerFragment
import com.bmob.lover.ui.fragment.lover.LoverPublishFragment
import com.bmob.lover.viewmodel.AlbumViewModel
import com.bmob.lover.viewmodel.LOLWelfareViewModel
import com.theone.mvvm.core.base.fragment.BasePagerPullRefreshFragment
import com.theone.mvvm.core.data.enum.LayoutManagerType
import com.theone.mvvm.core.databinding.BasePullFreshFragmentBinding
import com.theone.mvvm.core.app.ext.startImagePreview

//  ┏┓　　　┏┓
//┏┛┻━━━┛┻┓
//┃　　　　　　　┃
//┃　　　━　　　┃
//┃　┳┛　┗┳　┃
//┃　　　　　　　┃
//┃　　　┻　　　┃
//┃　　　　　　　┃
//┗━┓　　　┏━┛
//    ┃　　　┃                  神兽保佑
//    ┃　　　┃                  永无BUG！
//    ┃　　　┗━━━┓
//    ┃　　　　　　　┣┓
//    ┃　　　　　　　┏┛
//    ┗┓┓┏━┳┓┏┛
//      ┃┫┫　┃┫┫
//      ┗┻┛　┗┻┛
/**
 * @author The one
 * @date 2021-04-23 10:58
 * @describe TODO
 * @email 625805189@qq.com
 * @remark
 */
class LOLWelfareFragment :
    BasePagerFragment<LOLWelfare, LOLWelfareViewModel>() {

    override fun showTopBar(): Boolean = true

    override fun initView(root: View) {
        super.initView(root)
        getTopBar()?.run {
            setTitle("福利")
        }
    }

    override fun createAdapter(): BaseQuickAdapter<LOLWelfare, *> = LOLWelfareAdapter()

    override fun onItemClick(adapter: BaseQuickAdapter<*, *>, view: View, position: Int) {
        startImagePreview(mActivity, images = adapter.data as List<LOLWelfare>, position = position)
    }

    override fun getLayoutManagerType(): LayoutManagerType = LayoutManagerType.GRID

    override fun getSpanCount(): Int = 3

    override fun getItemSpace(): Int = 10

}